<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
	//定义函数
	function speak(sth){
		alert(sth);
	}
	var p=new Object();//定义对象
	p.name="jack";//动态添加属性
	alert(p.name);
	p.func=speak;//动态添加方法，func是方法名
	p.func("hello world!");
	
	//方法1，用delete删除
	delete p.name;
	alert(p.name);
	delete p.func;
	alert(p.func);
	
	//方法2，用undefined删除
	p.name=undefined;
	p.func=undefined;
	alert(p.name);
	alert(p.func);
</script>
</body>
</html>